package com.hasidea.android.smswish;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class EditMsgSent extends Activity {

	private Button editCancal,editOk,goBack,aboutUs; 
	private EditText  editmsgstr;
	private String editResultStr;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.editmsgsent);
		setviews();
		setListeners();
		
		Bundle bundle =   this.getIntent().getExtras();
		String msgstr = bundle.getString("msgstr");		
		editmsgstr.setText(msgstr);
	}
	
	private void setListeners() {
		editCancal.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				finish();
			}
		});
		editOk.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				editResultStr=editmsgstr.getText().toString();
				Intent i=new Intent();
				i.setClass(EditMsgSent.this, SelectContacts.class);
				i.putExtra(Intent.EXTRA_TEXT,editResultStr);
				startActivity(i);
				finish();
			}
		});
		goBack.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				finish();
			}
		});
        aboutUs.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				Intent intent=new Intent(EditMsgSent.this, AboutUs.class);
				startActivity(intent);
				
			}
		});
	}

	private void setviews(){
		editCancal = (Button)findViewById(R.id.EditCancal);
		editOk= (Button)findViewById(R.id.EditOk);
		goBack=(Button) findViewById(R.id.goback_Button);
		aboutUs=(Button)findViewById(R.id.aboutus_Button);
		
		editmsgstr = (EditText)findViewById(R.id.editMsgtoSent);
		
	}
	
}
